package com.iszhangsc.backup.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * <p>
 * 定时任务CRON表
 * </p>
 *
 * @author zhāngshìchāng
 * @date 2020/12/11 1:47 下午
 */
@Data
@Entity
@Table(name = "scheduled_cron")
@EntityListeners(AuditingEntityListener.class)
public class ScheduledCron {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键", example = "2")
    private Integer id;

    @ApiModelProperty(value = "编码,该值唯一", example = "2")
    private String code;

    @ApiModelProperty(value = "cron表达式", example = "0 0 0 * 1/3 ? *")
    private String cron;

    @CreatedDate
    @ApiModelProperty(value = "创建时间", example = "2020-11-11 11:11:11")
    private Date createTime;

    @LastModifiedDate
    @ApiModelProperty(value = "更新时间", example = "2020-11-11 11:11:11")
    private Date updateTime;


}
